home *** CD-ROM | disk | FTP | other *** search
- /*
- * a header of the class KBAN_DRAW
- * Copyright (C) 1996, 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
- */
-
- #ifndef _DRAW_H_
- #define _DRAW_H_
-
- // stdafx.h should be included already.
-
- #include "kbandata/kbandata.h"
-
- #include "common/flag.h"
-
- #include "drawinfo.h"
- #include "safedraw.h"
-
- class KBAN_DRAW : private SAFE_DRAW {
- const DRAW_INFO& m_grid;
- FLAG m_fill;
- FLAG m_hole;
- const FLAG* m_lflags;
-
- uint m_main_grid_width;
- uint m_sub_grid_width;
- XY m_grid_origin;
-
- COLORREF m_grid_color;
-
- class DRAW_ATTR {
- COLORREF m_color;
- bool m_xor;
- public:
- void set(COLORREF color, bool xor) {
- m_color = color;
- m_xor = xor ;
- }
- COLORREF color(void) const { return m_color; }
- bool xor(void) const { return m_xor; }
- };
- DRAW_ATTR m_layer_attr [LAYER_NUMBER];
- DRAW_ATTR m_cursor_attr[LAYER_NUMBER];
- DRAW_ATTR m_target_attr[LAYER_NUMBER];
- DRAW_ATTR m_erase_attr [LAYER_NUMBER];
- public:
- KBAN_DRAW(
- CDC* pDC,
- const DRAW_INFO& grid,
- const FLAG& fill,
- const FLAG& hole,
- const FLAG* lflags
- );
- private:
- void draw_sub_grid(void);
- void draw_main_grid(void);
- public:
- void draw_grid(void);
- private:
- void draw_box_core(const XY& ac1, const XY& ac2, const DRAW_ATTR& attr);
-
- void draw_primitive_pin_core (const PIN_ELEMENT& target, const DRAW_ATTR& attr);
- void draw_primitive_pin_hole_core(const PIN_ELEMENT& target, const DRAW_ATTR& attr);
-
- void draw_primitive_line_core(const LINE_ELEMENT& target, const DRAW_ATTR& attr);
-
- void draw_primitive_pin_list_core (const PIN_LIST& target, const DRAW_ATTR& attr);
- void draw_primitive_pin_list_hole_core(const PIN_LIST& target, const DRAW_ATTR& attr);
-
- void draw_primitive_line_list_core(const LINE_LIST& target, const DRAW_ATTR& attr);
-
- void draw_primitive_layer_core (const LAYER& target, const DRAW_ATTR& attr);
- void draw_primitive_layer_hole_core(const LAYER& target, const DRAW_ATTR& attr);
-
- void draw_primitive_core (const PRIMITIVE& target, uint layer_no, const DRAW_ATTR& attr);
- void draw_primitive_hole_core(const PRIMITIVE& target, uint layer_no, const DRAW_ATTR& attr);
-
- void draw_one_component_pin_list_core (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
- void draw_one_component_pin_list_hole_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
- void draw_one_component_line_list_core (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
- void draw_one_component_layer_core (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
- void draw_one_component_layer_hole_core (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
- void draw_one_component_core (const COMPONENT_ELEMENT& target, uint active_layer, const DRAW_ATTR attr_table[]);
- void draw_one_component_hole_core (const COMPONENT_ELEMENT& target, uint active_layer, const DRAW_ATTR attr_table[]);
-
- void draw_component_list_core (const COMPONENT_LIST& target, uint layer_no, const DRAW_ATTR& attr);
- void draw_component_list_hole_core(const COMPONENT_LIST& target, uint layer_no, const DRAW_ATTR& attr);
-
- void draw_kban_data_core (const KBAN_DATA& target, uint active_layer, const DRAW_ATTR attr_table[]);
- void draw_kban_data_hole_core(const KBAN_DATA& target, uint active_layer, const DRAW_ATTR attr_table[]);
- public:
- void draw_box (const XY& ac1, const XY& ac2);
- void draw_box_cursor(const XY& ac1, const XY& ac2);
- void erase_box (const XY& ac1, const XY& ac2);
-
- void draw_primitive_pin (const PIN_ELEMENT& target, uint layer_no);
- void draw_primitive_pin_cursor(const PIN_ELEMENT& target );
- void draw_primitive_pin_target(const PIN_ELEMENT& target );
- void erase_primitive_pin (const PIN_ELEMENT& target );
-
- void draw_primitive_line (const LINE_ELEMENT& target, uint layer_no);
- void draw_primitive_line_cursor(const LINE_ELEMENT& target );
- void draw_primitive_line_target(const LINE_ELEMENT& target );
- void erase_primitive_line (const LINE_ELEMENT& target );
-
- void draw_primitive_pin_list (const PIN_LIST& target, uint layer_no);
- void draw_primitive_pin_list_cursor(const PIN_LIST& target );
- void draw_primitive_pin_list_target(const PIN_LIST& target );
- void erase_primitive_pin_list (const PIN_LIST& target );
-
- void draw_primitive_line_list (const LINE_LIST& target, uint layer_no);
- void draw_primitive_line_list_cursor(const LINE_LIST& target );
- void draw_primitive_line_list_target(const LINE_LIST& target );
- void erase_primitive_line_list (const LINE_LIST& target );
-
- void draw_primitive_layer (const LAYER& target, uint layer_no);
- void draw_primitive_layer_cursor(const LAYER& target );
- void draw_primitive_layer_target(const LAYER& target );
- void erase_primitive_layer (const LAYER& target );
-
- void draw_primitive (const PRIMITIVE& target, uint layer_no);
- void draw_primitive_cursor(const PRIMITIVE& target, uint layer_no);
- void draw_primitive_target(const PRIMITIVE& target, uint layer_no);
- void erase_primitive (const PRIMITIVE& target, uint layer_no);
-
- void draw_one_component (const COMPONENT_ELEMENT& target, uint active_layer);
- void draw_one_component_cursor(const COMPONENT_ELEMENT& target, uint active_layer);
- void draw_one_component_target(const COMPONENT_ELEMENT& target, uint active_layer);
- void erase_one_component (const COMPONENT_ELEMENT& target, uint active_layer);
-
- void draw_component_list (const COMPONENT_LIST& target, uint layer_no);
- void draw_component_list_cursor(const COMPONENT_LIST& target, uint layer_no);
- void draw_component_list_target(const COMPONENT_LIST& target, uint layer_no);
- void erase_component_list (const COMPONENT_LIST& target, uint layer_no);
-
- void draw_kban_data (const KBAN_DATA& target, uint active_layer);
- void draw_kban_data_cursor(const KBAN_DATA& target, uint active_layer);
- void draw_kban_data_target(const KBAN_DATA& target, uint active_layer);
- void erase_kban_data (const KBAN_DATA& target, uint active_layer);
- };
-
- #endif /* _DRAW_H_ */
-